<!--
 * @Description: 服务中的用户饮食动态
 * @Version: 1.0
 * @Author: Yuanjy
 * @Date: 2020-05-13 17:35:40
 * @LastEditors: 任飞
 * @LastEditTime: 2020-06-25 11:57:54
 -->
<template>
  <div class="app-container" style="width: 100%;">
    <loading v-if="loading" />
    <div class="punch-dynamic" style="width:100%">
      <el-tabs v-model="activeName" style="width:100%" @tab-click="handleClick">
        <el-tab-pane label="早餐打卡" name="breakfast">
          <templateNo :data="data.breakfast" :type="'breakfast'" />
          <!-- <diet :data="data" /> -->
        </el-tab-pane>
        <el-tab-pane label="午餐打卡" name="lunch">
          <templateNo :data="data.lunch" :type="'lunch'" />
          <!-- <diet :data="data" /> -->
        </el-tab-pane>
        <el-tab-pane label="晚餐打卡" name="supper">
          <templateNo :data="data.supper" :type="'supper'" />
          <!-- <diet :data="data" /> -->
        </el-tab-pane>
        <el-tab-pane label="待回复消息" name="reply">
          <templateNo :data="data.reply" :type="'reply'" />
          <!-- <diet :data="data" /> -->
        </el-tab-pane>
        <el-tab-pane label="打卡未评分" name="uncomment">
          <templateNo :data="data.uncomment" :type="'uncomment'" />
          <!-- <uncomment :data="data" /> -->
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script>
import diet from './module/diet'
import uncomment from './module/uncomment'
import templateNo from './templateNo'
import loading from '@/views/components/loading1'

export default {
  components: {
    diet, uncomment, templateNo, loading
  },
  data() {
    return {
      activeName: 'breakfast',
      dietData: {},
      mealType: 'breakfast',
      serviceId: 1,
      type: '',
      weightShow: false,
      loading: false,
      dietData: {
        "id":187859,
        "note":"",
        "time":"2020-05-18 08:55:22",
        "img":[{"url":"https:\/\/qiezi-source-1.oss-cn-shanghai.aliyuncs.com\/upload\/jz\/wxa\/diet\/291162\/20200518\/breakfast_1589763311.jpg","attach":"b+37VbSFVxX9mWebrpwR\/w=="}],
        "evaluate":"\u54b1\u4eec\u5fae\u4fe1\u6c9f\u901a\u54c8~",
        "score":0,
        "nutris":{"cereal":{"name":"\u8c37\u85af\u4e3b\u98df","elments":[{"label":"\u6ce1\u996d\uff0c"}]},"meat_category":{"name":"\u8c46\u5976\u86cb\u8089\u9c7c","elments":[]},"fruit_vegetable":{"name":"\u852c\u83dc\u6c34\u679c","elments":[]},"nuts":{"name":"\u575a\u679c\u96f6\u98df\u751c\u70b9","elments":[]},"fried_food":{"name":"\u6cb9\u70b8\u70e7\u70e4\u718f\u5236\u7b49","elments":[]},"toast_food":{"name":"\u9152\u6c34\u996e\u6599","elments":[]}},
        "drink_water":0,"is_meal_powder":0,
        "comment_list":[{"id":174294,"item_id":187859,"item_type":"breakfast","sender_id":25,"sender_name":"\u8425\u517b\u5e08Cherry","receiver_id":0,"head":"https:\/\/wwxapi.qiezilife.com\/upload\/wwxapi\/upload\/2020-05-14\/a3a802b55ecc4e2b594bc908cc4ee5b7.jpg","receiver_name":"","content":"\u54b1\u4eec\u5fae\u4fe1\u6c9f\u901a\u54c8~","type":0,"add_time":"2020-05-18 13:39:06"}]
      },
      data: {
        breakfast: [],
        lunch: [],
        supper: [],
        reply: [],
        uncomment: []
      }
    }
  },
  created() {
    this.activeName = this.activeName = this.$route.query.tab || 'breakfast'
    // this.initData()
  },
  methods: {
    initData() {
      this.loading = true
      this.$api.permission.user
        .getUnprocessedInfo({})
        .then(res => {
          this.data.breakfast = res.data.breakfast
          this.data.lunch = res.data.lunch
          this.data.supper = res.data.supper
          if (res.data.reply) {
            this.data.reply = res.data.reply
          }
          if (res.data.uncomment) {
            this.data.uncomment = res.data.uncomment
          }
          this.loading = false
        }).catch(err => {
          console.log(err)
        })
    },
    handleClick() {
      
    },
    getDietInfo() {
      
    },
    showWeight(serviceId) {
      this.$refs['weight'].weightShow = true
      this.$refs['weight'].getWeightList(serviceId)
    }
  }
}
</script>

<style scoped>
  div {
    overflow: hidden;
  }
</style>

<style lang="less">
.punch-dynamic {
  .el-tabs__item {
    font-size: 16px;
    padding: 0 20px;
  }
  .el-tabs__active-bar {
    padding: 0 20px;
  }
}
</style>
